package appapi.service.impl;

import appapi.Global.BusinessException;
import appapi.Request.ApiReq.EquipWarnApiReq;
import appapi.dao.EquipInfoMapper;
import appapi.dto.EquipInfoDto;
import appapi.entity.Zhongjiao.EquipInfoEntity;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import appapi.dao.EquipWarnMapper;
import appapi.entity.Zhongjiao.EquipWarnEntity;
import appapi.service.EquipWarnService;

import java.util.List;

/**
 * @author djq
 * @date 2023/8/7 11:23
 * @description:
 */

@Service
public class EquipWarnServiceImpl implements EquipWarnService {

    @Resource
    private EquipWarnMapper equipWarnMapper;
    @Resource
    EquipInfoMapper equipInfoMapper;


    @Override
    public int deleteByPrimaryKey(Long warnId) {
        return equipWarnMapper.deleteByPrimaryKey(warnId);
    }

    @Override
    public int insert(EquipWarnEntity record) {
        return equipWarnMapper.insert(record);
    }

    @Override
    public int insertSelective(List<EquipWarnEntity> record) {

        return 0;
    }

    @Override
    public EquipWarnEntity selectByPrimaryKey(Long warnId) {
        return equipWarnMapper.selectByPrimaryKey(warnId);
    }

    @Override
    public int updateByPrimaryKeySelective(EquipWarnEntity record) {
        return equipWarnMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int updateByPrimaryKey(EquipWarnEntity record) {
        return equipWarnMapper.updateByPrimaryKey(record);
    }

    @Override
    public PageInfo<EquipWarnEntity> selectPage(EquipWarnApiReq req) {
        PageHelper.startPage(req.getCurrentPage(), req.getPageSize());
        List<EquipWarnEntity> list = equipWarnMapper.selectAll(req);

        return new PageInfo<>(list, req.getPageSize());
    }

}


